Product Information from: Object Resource Corporation 4323 Brown No. 249 Dallas, TX 75219 214-528-2745 ------------------------------- Component Classes for NetWare ------------------------------- Modules I & II: Bindery, Queue, Printing, Workstation, Connection, File and Directory-related C++ Classes These classes form a C++ object oriented interface to NetWare 286 and NetWare 386 system calls and are designed for easy use by both experienced and novice NetWare programmers. - Object-oriented design produces classes which are easy to learn and easy to use - Interface is far less complex, more intuitive than 'C' interface - Byte-swapping issues are encapsulated within the classes - Includes utility classes for decoding errors - Bindery classes include NWBindery, NWObject, NWProperty and NWSecurity - Queue classes include NWStdJobHeader, NWQueue, NWJob and NWJobServer - Print service classes include NWLPTDevice and NWCaptureFlags - Connection classes include NWShell, NWShellConnection, NWDrive, NWFileServer - Class NWDrive contains methods for drive mapping - Iterator (aka cursor) classes to traverse a set of objects (e.g. NWFileIterator) - Objects transparently send NetWare requests to the correct connected file server - Completely independent from other class libraries (e.g. MFC) - Complete class reference, manual and examples included - Examples include C++ versions of example code from Rose programmer's guide - Source code free to registered users - Use in DOS or Windows environment - Versions for Borland, Microsoft compilers ORC tools are designed as flexible, easy to use software components for application programming. The C++ interface is less complex and less error prone than the standard 'C' or assembly interfaces, yielding a shorter development time and -- with good application design -- code which is much more resilient to change. Version: 1.1 Release: Nov '93 Suggested Retail: $299 NetWare API: NetWare 2.x & 3.x Compilers: Borland 3.1 and Microsoft 7.00 Environments: DOS and MS Windows General Description ------------------- Object Resource Corporation's Component Classes for NetWare is a software library which organizes the NetWare API into C++ classes. These classes -- released in several modules -- include bindery, job queue, print services, connection, workstation, file and directory related classes. Design Goals ------------ The great majority of an API's functions requires a programmer to be continually aware of both the logical goal of the task at hand and the implementation details required to implement the task successfully. It is this coupling of logical issues with implementation issues which often makes an API difficult to understand and use. The primary goal in the design of these classes is to separate the logical issues from the implementation issues -- to separate the what from the how. The resulting interface allows a programmer to concentrate on the logical task at hand without being distracted by implementation details. Each class's methods should be usable in a direct, intuitive manner, requiring only a working knowledge of the NetWare concepts involved (e.g., knowing that the NetWare shell maintains connections with up to eight file servers). This will considerably shorten the learning curve required to use the API. A high percentage of programming errors occurs while dealing with the many details of implementation. Since the classes hide as much implementation as possible, there are fewer errors, resulting in a shorter development time. The downside of this design approach is that sometimes a programmer must do extra work to accomplish a very specific task (e.g. declaring several objects in order to reach the one with the desired function member). In this case it would be desirable to simply 'call a function', so we have used function overloading and static functions to provide such alternatives to the programmer. Class Listing for Modules I & II -------------------------------- Class Parent Comments NWBindery belongs to a file server -- contains objects NWObject has properties NWFileServer NWObject has bindery & set of volumes NWJobQueue NWObject has set of queued jobs NWJobServer NWObject NWCurrentServer NWJobServer for use in job server code NWProperty NWSetProperty NWProperty has set of corresponding bindery objects NWValueProperty NWProperty has value NWValue NWSecurity bindery access levels _NWJob base class -- adapt for custom job types NWJob _NWJob standard job type NWPrintServices shell's printing redirection services NWLPTDevice e.g. LPT1: NWCaptureFlags NWShell global to a workstation -- manages connections NWShellConnection one of eight shell connections NWDrive Drives A,B,C... NWVolume contained by file server...has a root directory NWDirectory contains subdirectories, files & trustees NWFile NWTrustee relates a directory to a bindery object NWRights NetWare trustee rights or maximum rights Iterator Classes ---------------- Iterator classes exist whenever an object has a set of objects related to it (e.g. a containing relationship). Iterators are used to traverse the set of related objects. A NWFileIterator object, for instance, is used to traverse the set of a directory's files; a NWObjectIterator object to traverse a given set of bindery objects. Example Code Fragments ---------------------- Attach and Login to File Server: ------------------------------- NWFileServer server("ServersName"); NWShellConnection *connection = NWShell::AttachToFileServer(server); if( connection ) int result = Server.LoginToServer("UsersName","UsersPassword"); Map a Drive: ----------- NWDrive drive('H'); int stat = drive.MapDrive("\PROGS\EXAMPLES"); List Files in Directory: ----------------------- NWDirectory *directory = drive.Directory(); // 'drive' from prev. example if( directory ) NWFileIterator fileSet = directory->GetFileIterator(); while( fileSet ) // while there is another file { NWFile *file = fileSet.Current(); cout << "File name = " << file->Name() << endl; delete file; // deletes in-memory object...not actual file! fileSet++; } Add Job to Existing Queue: ------------------------- NWJobQueue Q(QUEUE_NAME,QUEUE_TYPE); NWJob job; int result = Q.AddJob(job); if( !result ) // if no error { job.NETQ << "Writing to job's open fstream" << endl; job.CloseAndStart(); } Display Text for Error Code: --------------------------- cout << "Error " << errorNumber << " deleting file: " << NWDirectoryError(errorNumber) << endl; Display Shell's Connections: --------------------------- for(int connNo=1; connNo<=8; connNo++) { NWShellConnection connection(connNo); cout << "Connection #" << connNo; if( connection.IsInUse() ) cout << " is connected to server " << connection.ServerName() << endl; else cout << " is not in use." << endl; }